<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        table thead {
            background-color: aqua;
        }

        table {
            width: 100%;
            /*border-collapse: collapse;*/
            border-collapse: separate;
            text-align: center;
            table-layout: fixed;
        }

        .table {
            width: 400px;
            height: 200px;
            overflow: auto;
            border: 1px solid #333;
            box-sizing: border-box;
        }

        tr td,
        td{
            height:50px;
            width:100px;
            border-bottom:1px solid #333;
            border-right:1px solid #333;
        }

        thead tr:nth-child(1){
            position:sticky;
            top:0;
            left:0;
            box-sizing: content-box;
            z-index:100;
            background-color: aqua;
        }

        thead tr:nth-child(2){
            position:sticky;
            top:25px;
            z-index:100;
            background-color: aqua;
        }
    </style>
</head>
<body>
<div class="table">
    <table border cellspacing="0" cellpadding="0">
        <thead>
        <tr>
            <th rowspan="2">姓名</th>
            <th colspan="3">基本信息</th>
            <th colspan="2">重要信息</th>
        </tr>
        <tr>
            <th>年龄</th>
            <th>年级</th>
            <th>班主任</th>
            <th>爱好</th>
            <th>备注</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        <tr>
            <td>jack</td>
            <td>15</td>
            <td>高三</td>
            <td>张老师</td>
            <td>打篮球</td>
            <td>优秀</td>
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>
